<layout name="layout" />
<link rel="stylesheet" href="/Css/ranking.css" type="text/css">
<div class="pageheader notab">
    <h1 class="pagetitle">
        <a href="/" class="linkWay">首页/智能卡位/我的卡位策略</a>
        &nbsp;<span class="divider">»</span>&nbsp;
        <a href="/ranking/ranking_list" class="linkWay">我的卡位策略</a>
        &nbsp;<span class="divider">»</span>&nbsp;
        <a href="#" class="currentWay">详情</a>
    </h1>
</div>
<invoke method="get" path="algorithmservice/users/'.$me['user_id'].'/rankings/'.$tactics_id.'"></invoke>
<div id="contentwrapper" class="contentwrapper">
    <div id="campaign_relation" style="overflow:hidden;">
        <ul style="display:;text-align:center;border:1px solid #ccc;float:left;">
            <li style="border-right:1px solid #ccc;text-align:center;">名称:&nbsp;{$objResult['tactics_name']}</li>
            <li style="border-right:1px solid #ccc;text-align:center;">状态:&nbsp;
                <switch name="objResult['tactics_status']">
                    <case value="1">开启</case>
                    <case value="2">暂停</case>
                    <case value="3">完成</case>
                </switch>
            </li>
            <li style="border-right:1px solid #ccc;text-align:center;">卡位轮次:&nbsp;{$objResult['executions']}</li>
            <li style="text-align:center;">上次卡位时间:&nbsp;{$objResult['tactics_modified_time']}</li>
        </ul>
    </div>
    <div class="toolbar">
        <div class="inline-block">
            <a id="originalValue" href="javascript:;;" class="button stdbtn btn btn3 btn_grey add-con">恢复原价</a>
        </div>
        <div class="inline-block" id="table_datepicker"></div>
    </div>
    <div class="ranking-keywords">
        <table id="dataList">
            <thead>
            <tr>
                <th width="24px"><a id="selectAll" class="btn btn3 btn_unselectall btn_selectall tooltips" href="javascript:void(0);" title="全选">全选</a></th>
                <th width="80px">计划</th>
                <th width="100px">推广组</th>
                <th width="100px">关键词</th>
                <th width="auto">原始出价</th>
                <th width="auto">当前出价</th>
                <th width="auto">当前排名</th>
                <th width="auto">期望排名</th>
                <th width="auto">展现量</th>
                <th width="auto">点击量</th>
                <th width="auto">点击率</th>
                <th width="auto">ppc</th>
                <th width="auto">总花费</th>
                <th width="auto">roi</th>
                <th width="auto">总成交金额</th>
                <th width="auto">总成交笔数</th>
                <th width="auto">收藏数</th>
                <th width="auto">购物车数</th>
            </tr>
            </thead>
            <tbody>
            <volist name="objResult['items']" id="msg">
                <tr class="keyword" data-keyword_id="{$msg['want_rank']['keywordID']}" data-adgroup_id="{$msg['keyword']['adgroupId']}" data-max_price="{$msg['keyword']['maxPrice']}" data-match_scope="{$msg['keyword']['matchscope']}" data-max_mobile_price="{$msg['keyword']['maxMobilePrice']}" data-mobile_is_default_value="{$msg['keyword']['mobileIsDefaultPrice']}">
                    <td><input type="checkbox" class="select_items" data-keyword_id="{$msg['want_rank']['keywordID']}" id="keyword_id{$msg['want_rank']['keywordID']}" /></td>
                    <td>
                        <a href="/campaign/manage?campaign_id={$msg['keyword']['campaignId']}">{$msg['campaign_name']}</a>
                    </td>
                    <td>
                        <a href="/adgroup/manage?adgroup_id={$msg['keyword']['adgroupId']}">{$msg['adgroup_name']}</a>
                    </td>
                    <td class="word">{$msg['word']}</td>
                    <td class="original_value" data-original_price="{$msg['want_rank']['originalValue']}">
                        ￥{$msg['want_rank']['originalValue']/100}
                    </td>
                    <td class="max_price" data-current_price="{$msg['keyword']['maxPrice']}" data-current_mobile_price="{$msg['keyword']['maxMobilePrice']}">
                        <if condition="$objResult['device'] == 1">
                            ￥{$msg['keyword']['maxMobilePrice']/100}<else/>￥{$msg['keyword']['maxPrice']/100}
                        </if>
                    </td>
                    <td class="rank item-loading"></td>
                    <td class="want_rank item-loading" data-want_rank="{$msg['want_rank']['wantRank']}"></td>
                    <td>{$msg['report']['impressions']}</td>
                    <td>{$msg['report']['ctr']|round=0}</td>
                    <td>{$msg['report']['cvr']}</td>
                    <td>{$msg['report']['cpc']}</td>
                    <td>{$msg['report']['cost']/100}</td>
                    <td>{$msg['report']['roi']}</td>
                    <td>{$msg['report']['directPay']/100 + $msg['report']['indirectPay']/100}</td>
                    <td>{$msg['report']['directPayCount'] + $msg['report']['indirectPayCount']}</td>
                    <td>{$msg['report']['favItemCount']}</td>
                    <td>{$msg['report']['cartTotal']}</td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</div>


<script type="text/javascript">
    var tactics_id = {$tactics_id};
    var user_id = {$me['user_id']};
    var device = '{$objResult["device"]}';
    $(document).ready(function(){
        var $container = $('.contentwrapper');
        ranking.detail($container, {
            tactics_id: tactics_id,
            user_id: user_id,
            device: device == '1'?'mobile':'pc'
        }).init();
    });
</script>